<?php 
    use yii\helpers\Html;
	use yii\helpers\Url;
    use yii\bootstrap\ActiveForm;
?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
    <meta charset="<?= Yii::$app->charset?>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= Html::encode($title) ?></title>
    <link rel="shortcut icon" href="favicon.ico"> 
    <?= Html::cssFile('@web/statics/css/bootstrap.min.css?v=3.3.6') ?>
    <?= Html::cssFile('@web/statics/css/font-awesome.min.css?v=4.4.0') ?>
    <?= Html::cssFile('@web/statics/css/animate.min.css') ?>
    <?= Html::cssFile('@web/statics/css/style.min.css?v=4.1.0') ?>
    <?= Html::cssFile('@web/statics/css/plugins/iCheck/custom.css') ?>
    <?= Html::jsFile('@web/statics/js/jquery.min.js') ?>
    <?= Html::jsFile('@web/statics/js/plugins/iCheck/icheck.min.js') ?>
    <style type="text/css"> 
        .help-block-error { 
            float: left;
        }
    </style>
</head>
<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">GD</h1>

            </div>
            <h3>欢迎登录后台</h3>
            
            <?php $form = ActiveForm::begin([
                'id' => 'login-form',
                'options' => [ 
                        'class' => 'm-t',
                        'role' => 'form'
                    ], 
            ]); ?><?= $form->field($model,'username')->textInput(['autofocus' => true,'placeholder'=>'用户名','required'=>'required'])->label(false) ?>

                <?= $form->field($model, 'password')->passwordInput(['placeholder'=>'密码','required'=>'required'])->label(false) ?>	
 				<?= $form->field($model,'verifycode')->widget(yii\captcha\Captcha::className(),['template' => '<div class="row" style="float:left"><div class="col-lg-6">{input}</div><div class="col-lg-4">{image}</div></div>','captchaAction' => 'site/captcha','options'=>['placeholder'=>'验证码','class'=>'form-control'],'imageOptions'=>['alt'=>'点击刷新','title'=>'换一张']]
				)->label(false) ?>
 				<?= $form->field($model, 'rememberMe',['options'=>['style'=>'float:left;clear:both'],'labelOptions'=>['style'=>'float:left;padding-left:0px;','label'=>'记住密码']])->checkbox(['class'=>'i-checks']) ?>
                <?= Html::submitButton('登录', ['class' => 'btn btn-primary block full-width m-b', 'name' => 'login']) ?>
                <!-- <p class="text-muted text-center"> <a href="login.html#"><small>忘记密码了？</small></a> | <a href="register.html">注册一个新账号</a> 
                </p> -->
            <?php ActiveForm::end(); ?>       
        </div>
    </div>
    <script>
 		$(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
    </script>
    <script>
    	//刷新验证码
    	$(document).on('click','#loginform-verifycode-image',function(){ 
    		$.getJSON("<?= Url::to(['site/captcha','refresh'=>1]) ?>", function(result){
                $("#loginform-verifycode-image").attr("src",result.url);
            });
    	})
    </script>
</body>
</html>